﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AWP_Vl_4_Generics
{
    class GenericClass<T> where T:MyInterface
    {
       private T[] typeArray = new T[10];

        public void setElement(T element, int position)
        {
            typeArray[position] = element;
        }

        public T getElement(int position)
        {
            return typeArray[position];
        }

        public void printElement(int position)
        {
            if (typeArray[position] != null ) {
                typeArray[position].printSampleText();
            }
        }

    }
}
